<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on March 10, 2009 at 3:20:28 pm</time-stamp>


<class>
<name>PolicyTest</name>
<environment>SupplyChain</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>p </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.PolicyTest class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.PolicyTest</class-id>
<body>Tests a policy.

Instance Variables:
	p	&lt;Object&gt;	The policy to test

</body>
</comment>

<methods>
<class-id>SupplyChain.PolicyTest</class-id> <category>accessing</category>

<body package="SupplyChain" selector="p">p
	^p</body>

<body package="SupplyChain" selector="p:">p: anObject
	p := anObject</body>
</methods>

<methods>
<class-id>SupplyChain.PolicyTest</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Edit the following to properly initialize instance variables ***"
	p := nil.
	" *** And replace this comment with additional initialization code *** "
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.PolicyTest</class-id> <category>Running</category>

<body package="SupplyChain" selector="setUp">setUp
	"Sets up the test variable"

	p := Policy withDifference: 20.</body>

<body package="SupplyChain" selector="testPriceDifference">testPriceDifference
	"Tests that the price difference works"

	p priceDifference: 16.
	self assert: p priceDifference = 16.
	p priceDifference: 23.
	self assert: p priceDifference = 23.
	self deny: (p priceDifference = 255)</body>
</methods>

</st-source>
